import { ProviderType, ChannelType } from '../common/commlib.enums';
import { IDeviceConfiguration } from '../common/commlib.interfaces';

export class ConfigurationService {
  private deviceConfigurations: IDeviceConfiguration[] = [
    {
      id: 'SAP-AWS-CONNECT',
      key: 'SAP-AWS-CONNECT',
      name: 'SAP AWS Connect',
      isActive: true,
      type: ProviderType.PREDEFINED,
      location: {
        path: '../providers/aws-connect/aws-device-provider',
        className: 'AWSDevice'
      },
      channels: [ChannelType.PHONE],
      parameters: {
        ccpURL: 'https://core-grm.awsapps.com/connect/ccp',
        globalScripts: [
          {
            url:
              'https://cs-ngx-thirdparty-libs-v1.cfapps.sap.hana.ondemand.com/libs/aws/connect-streams-min.js'
          }
        ]
      }
    },
    {
      id: 'SENDBIRD',
      key: 'SENDBIRD',
      name: 'SendBird',
      isActive: true,
      type: ProviderType.PREDEFINED,
      location: {
        path: '../providers/sendbird/sendbird-device',
        className: 'SendBirdDevice'
      },
      channels: [ChannelType.CHAT],
      parameters: {
        appId: '1420A8B8-B95A-4EC3-972A-89C02089D239',
        apiToken: 'ec0daad685702f7dcdb8a7c61d9225b1d38adcd4',
        apiRequestUrl:
          'https://api-1420A8B8-B95A-4EC3-972A-89C02089D239.sendbird.com'
      }
    },
    {
      id: 'SENDBIRD',
      key: 'SENDBIRD',
      name: 'SendBird',
      isActive: false,
      type: ProviderType.DYMAMICLOAD,
      location: {
        path:
          'https://cs-ngx-thirdparty-libs-v1.cfapps.sap.hana.ondemand.com/devices/bundle.js',
        className: 'SendBirdDevice'
      },
      channels: [ChannelType.CHAT],
      parameters: {
        appId: '1420A8B8-B95A-4EC3-972A-89C02089D239',
        apiToken: 'ec0daad685702f7dcdb8a7c61d9225b1d38adcd4',
        apiRequestUrl:
          'https://api-1420A8B8-B95A-4EC3-972A-89C02089D239.sendbird.com'
      }
    }
  ];

  constructor() {
    // initial things
  }

  public getConfigurations(): IDeviceConfiguration[] {
    // TODO: it should be refined after configuration service is ready.
    return this.deviceConfigurations;
  }
}
